package com.chengjue.transaction.learn.thread.thread;

/**
 * 描述:
 *
 * @author Kipeng Huang
 * @create 2018-03-04 上午11:23
 */
public class JoinTest {
	public static void main(String[] args) throws InterruptedException {
		ThreadJoinTest t1 = new ThreadJoinTest("lss");
		ThreadJoinTest t2 = new ThreadJoinTest("kipeng");
		t1.start();
		t1.join();
		t2.start();
		System.out.println("main thread");
	}

	static class ThreadJoinTest extends Thread {
		public ThreadJoinTest(String name) {
			super(name);
		}

		@Override
		public void run() {
			for (int i = 0; i < 100; i++) {
				System.out.println(this.getName());
			}
		}
	}
}
